package com.song.api.controller.user;

import com.song.api.config.MyServiceList;
import com.song.api.controller.user.fallbacks.UserFallbackFactor;
import com.song.grace.result.GraceJSONResult;
import com.song.pojo.bo.UpdateUserInfoBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(value = "用户信息相关controller", tags = {"用户信息相关controller"})
@RequestMapping("user")
@FeignClient(value = MyServiceList.SERVICE_USER ,fallbackFactory = UserFallbackFactor.class)
public interface UserControllerApi {

    @PostMapping("getUserInfo")
    @ApiOperation(value = "获得用户基本信息", notes = "获得用户基本信息", httpMethod = "POST")
    public GraceJSONResult getUserInfo(@RequestParam String userId);

    @PostMapping("getAccountInfo")
    @ApiOperation(value = "获得用户账户信息", notes = "获得用户账户信息", httpMethod = "POST")
    public GraceJSONResult getAccountInfo(@RequestParam String userId);

    @PostMapping("updateUserInfo")
    @ApiOperation(value = "完善用户信息", notes = "完善用户信息", httpMethod = "POST")
    public GraceJSONResult updateUserInfo(@RequestBody @Valid UpdateUserInfoBO updateUserInfoBO);

    @GetMapping("queryByIds")
    @ApiOperation(value = "根据用户id查询用户基本信息", notes = "根据用户id查询用户基本信息", httpMethod = "GET")
    public GraceJSONResult queryByIds(@RequestParam String userIds);

}


